/*
Java source file
Copyright: Umschalt.com 2012
*/
package com.david.documentation.web.view.pages;

import com.david.documentation.service.category.CategoryService;
import com.david.documentation.service.doku.DokuService;
import com.david.documentation.service.link.LinkService;
import com.david.documentation.service.parser.DokuJunkiesParserServiceImpl;
import com.david.documentation.service.tag.TagService;
import com.david.documentation.web.BasePage;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.spring.injection.annot.SpringBean;

public class StartParserPage extends BasePage{

	@SpringBean
	private DokuService dokuService;
	@SpringBean
	private LinkService linkService;
	@SpringBean
	private CategoryService categoryService;
	@SpringBean
	private TagService tagService;

	public StartParserPage(){

		final DokuJunkiesParserServiceImpl parser = new DokuJunkiesParserServiceImpl(dokuService, linkService, categoryService, tagService);

		IndicatingAjaxLink startparser = new IndicatingAjaxLink("startparser") {

			@Override
			public void onClick(AjaxRequestTarget target) {
				parser.parse();
			}
		};
		add(startparser);

	}
}
